<template>
  <div class="head">
    <div @click="tab">
      <div>
        <button id="1" :class="id==='1'?'active':''" class="title">账户信息</button>
      </div>
      <div>
        <button id="2" :class="id==='2'?'active':''" class="title">关联账号</button>
      </div>
      <div>
        <button id="3" :class="id==='3'?'active':''" class="title">账号安全</button>
      </div>
      <div>
        <button id="4" :class="id==='4'?'active':''" class="title">声音设置</button>
      </div>
    </div>
    <account v-if="id==='1'" style="width: 100%;" />
    <associated v-if="id==='2'" style="width: 100%;" />
    <security v-if="id==='3'" style="width: 100%;" />
    <sound v-if="id==='4'" style="width: 100%;" />
  </div>
</template>

<script>
import account from '@/views/PersonalCenter/Account/index'
import associated from '@/views/PersonalCenter/Associated/index'
import security from '@/views/PersonalCenter/Security/index'
import sound from '@/views/PersonalCenter/Sound/index'
export default {
  name: 'Dashboard',
  components: {
    account,
    associated,
    security,
    sound
  },
  data() {
    return {
      id: '1'
    }
  },

  computed: {},

  created() {},

  methods: {
    tab(e) {
      if (e.target.id) {
        this.id = e.target.id
      }
    }
  }
}

</script>
<style  scoped lang="scss">
.head{
  margin-top: 30px;
  display: flex;
  padding-right: 30px;
  .title{
    width: 284px;
height: 56px;
line-height: 56px;
text-align: center;
font-size: 18px;
font-family: Source Han Sans CN;
font-weight: 600;
color: #333333;
border: 1px #fff solid;
background-color: #fff;
  }
  .active{
    color: #2087D0;
    background: #E7F3FB;
  }
}

</style>
